﻿using System;
using System.Collections.Generic;
using PrearrangedChaos.AgileZen.Service.Model;
using PrearrangedChaos.AgileZen.Service.Rest;

namespace PrearrangedChaos.AgileZen.Service
{
    internal class ZenRoleCollection<TCollection> : ZenResourceCollection<TCollection, IRole>, IZenRoleEnumerable
        where TCollection : class, IPagingResponse<IRole>
    {
        public ZenRoleCollection(string apiKey, int pageSize, int projectId)
            : base(apiKey, RestArguments.Role(projectId, pageSize))
        {
        }

        public IZenResourceEnumerable<IRole> Filter(Func<IRoleFilter, ZenFilter> filter)
        {
            SetFilter<RoleFilter>(filter);
            return this;
        }
    }
}